//定义service层
app.service('brandService',function ($http) {
    //定义方法读取列表数据
    this.brandInfo=function (page,rows) {
        return	 $http.get('../brand/findAll.do?page=' + page + '&rows=' + rows);
    }


    //保存
    this.addInfo=function (editBrand) {
        return 		$http.post('../brand/addBrand.do', editBrand);
    }
    //修改
    this.editInfo=function (editBrand) {
        return   $http.put('../brand/updateBrand.do', editBrand);
    }
    //删除
    this.deleteBrand=function (ids) {
        //获取选中的复选框
        return	 $http.post('../brand/deleteBrand.do?ids=' + ids);
    }


    //条件查询
    this.search=function (page,rows,searchEntity){
        return $http.post('../brand/search.do?page='+page+"&rows="+rows,searchEntity);
    }


    //分页
    this.findPage=function (page,rows){
       return $http.get('../brand/findPage.do?page=' + page + '&rows=' + rows);
    }

    //下拉列表数据
    this.selectOptionList=function () {
        return $http.get('../brand/selectOptionList.do');
    }

});